%plot_modelirf.m

function plot_modelirf(irf)

% length of IRFs
T = size(irf.Y,1);
t = 1:T;

% IRFs of TFP measures to different shocks
figure
for i = 1:size(irf.shocknames,2)
    subplot(3,3,i)
    plot(t,irf.tech(:,i),'-k',t,irf.TFPc(:,i),'-r',t,irf.TFP(:,i),'--k',t,irf.TFPu(:,i),'--r','Linewidth',2)
    legend('Technology','Corrected TFP','TFP','utiliz-adj TFP')
    grid on
    title(irf.shocknames(i))
end

% IRFs of model variables to different shocks
for i = 1:size(irf.shocknames,2)
    figure
    subplot(3,3,1)
    plot(t,irf.tech(:,i),'-k',t,irf.TFPc(:,i),'-r',t,irf.TFP(:,i),'--k',t,irf.TFPu(:,i),'--r','Linewidth',2)
    legend('Technology','Corrected TFP','TFP','utiliz-adj TFP')
    grid on
    title(irf.shocknames(i))

    subplot(3,3,2)
    plot(t,irf.C(:,i),'-k','Linewidth',2)
    title('C')
    grid on

    subplot(3,3,3)
    plot(t,irf.hN(:,i),'-k','Linewidth',2)
    title('hN')
    grid on

    subplot(3,3,4)
    plot(t,irf.Pi(:,i),'-k','Linewidth',2)
    title('\pi')
    grid on

    subplot(3,3,5)
    plot(t,irf.e(:,i),'-k','Linewidth',2)
    title('e')
    grid on

    subplot(3,3,6)
    plot(t,irf.h(:,i),'-k','Linewidth',2)
    title('h')
    grid on

    subplot(3,3,7)
    plot(t,irf.z(:,i),'-k','Linewidth',2)
    title('z')
    grid on

    subplot(3,3,8)
    plot(t,irf.u(:,i),'-k',t,irf.uob(:,i),'--k','Linewidth',2)
    legend('u','uob')
    grid on

    subplot(3,3,9)
    plot(t,irf.N(:,i),'-k','Linewidth',2)
    title('N')
    grid on
end

